<?php
session_start();
header('Content-Type: text/html; charset=utf-8');
//error_reporting (0);
define ('DIR', DIRECTORY_SEPARATOR) ;
$sitePath = realpath(dirname(__FILE__) . DIR . '..' . DIR) . DIR ;
define ('SITEPATH', $sitePath) ;
require_once 'includs/startup.php' ;
$registry = new Access_Registry ;
$template = new Access_Template($registry) ;
$registry->set ('view', $template) ;
require_once 'app/access/db.php' ;
$db = new Access_Db ;
$router = new Access_Router($registry);
$registry->set('sitePath', DIR . $db->path) ; 
$registry->set ('router', $router);
$registry->set('controllersPath', 'app/controller') ;
$router->setPath ($registry->get('controllersPath')) ;
?>
<!DOCTYPE html>
<html>
  <head>
    <title>Сайт центру дистанційного навчання</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="/<?php echo $db->path ; ?>libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/<?php echo $db->path ; ?>libs/styles/style.css" rel="stylesheet">
    <script type="text/javascript" src="/<?php echo $db->path ; ?>libs/ckeditor/ckeditor.js"></script>
    <script src="/<?php echo $db->path ; ?>libs/ckeditor/_samples/sample.js" type="text/javascript"></script>
    <link href="/<?php echo $db->path ; ?>libs/ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
    <?php
    require_once 'app/views/navbar.php';//<====================NAVBAR===========
    ?>
    <div class="container wrapper">
      <div class="header-logo">
      </div>
      <div class="span12 no-margin">
        <div class="row">
          <div class="span2">
            <div class="well">
                <?php
                  require_once 'app/views/menu.php';//<========SIDE-MENU========
                ?>
            </div>
          </div>
          <div class="span8">
            <div class="well">
              <?php
                $router->delegate();//<========================CONTENT==========     
              ?>
            </div>
          </div>
          <div class="span2">
            <?php
              require_once 'app/views/news.php';
            ?>
          </div>  
        </div>
      </div>
    </div>
    <div class="container footer">
      <div class="span12 no-margin">
        <?php
          require_once 'app/views/footer.php';//<================FOOTER=========
        ?>
      </div>
    </div>   
<!--js-->    
    <script src="/<?php echo $db->path ; ?>libs/jquery/jquery.js"></script>
    <script src="/<?php echo $db->path ; ?>libs/bootstrap/js/bootstrap.js"></script>
    <script src="/<?php echo $db->path ; ?>libs/bootstrap/js/bootstrap-alert.js"></script>
    <script src="/<?php echo $db->path ; ?>libs/bootstrap/js/bootstrap-dropdown.js"></script>
    <script src="/<?php echo $db->path ; ?>libs/bootstrap/js/bootstrap-carusel.js"></script>
    <script src="/<?php echo $db->path ; ?>libs/bootstrap/js/bootstrap-transition.js"></script>
    <script>
      $('.carousel').carousel({
        interval: 5000
      });
      $('.dropdown-toggle').dropdown()
    </script>
<!--js-->   
  </body>
</html>
